package com.university.evaluation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.university.evaluation.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    
    /**
     * 根据用户ID（学号/工号）查找用户
     */
    @Select("SELECT * FROM t_user WHERE student_id = #{studentId}")
    User findByStudentId(String studentId);
    
    /**
     * 根据用户名查找用户（兼容旧接口，实际使用userId）
     */
    @Select("SELECT * FROM t_user WHERE username = #{username}")
    User findByUsername(String username);
}
